
package cn.com.cifi.mars.web.action.operateplan;

import java.util.List;

import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.com.cifi.mars.bean.vo.returnPlan.ReturnCoefficientContentVo;
import cn.com.cifi.mars.bean.vo.returnPlan.ReturnPlanApprovalPreviewVo;
import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.common.constants.VersionConstant;
import cn.com.cifi.mars.entity.ReturnCoefficientDetail;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;


/**
 * 类名称：IReturnCoefficientController
 * 类描述：回款系数API
 * 创建人：yyd
 * 创建时间：2019年9月4日 上午10:45:53
 *
 * @version 1.0.0
 */
@Api(tags = "回款系数API")
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/returnCoefficient")
public interface IReturnCoefficientController {

    @ApiOperation(value = "查询回款系数版本列表", notes = "查询回款系数版本列表")
    @GetMapping(value = "/queryVersion")
    R getReturnVersionList(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "项目ID", required = true, defaultValue = "") @RequestParam(name = "projectId") String projectId,
            @ApiParam(value = "版本类型", required = true, defaultValue = "") @RequestParam(name = "versionType") String versionType);

    @ApiOperation(value = "查询回款系数详情", notes = "查询回款系数详情")
    @GetMapping(value = "/queryDetail")
    R returnCoefficientDetail(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "回款系数版本Id", required = true, defaultValue = "") @RequestParam(name = "versionId") String coefficientId);

    @ApiOperation(value = "生成实际版回款系数（单个项目）", notes = "生成实际版回款系数（单个项目）")
    @PostMapping(value = "/createPractical")
    R createPractical(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "项目id", required = true, defaultValue = "") @RequestParam(name = "projectId") String projectId);

    @ApiOperation(value = "生成实际版回款系数（全量项目）", notes = "生成实际版回款系数（全量项目）")
    @PostMapping(value = "/createAllPractical")
    R createAllPractical(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion);

    @ApiOperation(value = "新建调整版回款系数", notes = "新建调整板回款系数")
    @PostMapping(value = "/create")
    R create(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "项目ID", required = true) @RequestParam(value = "projectId") String projectId);

    @ApiOperation(value = "删除回款系数", notes = "删除回款系数")
    @DeleteMapping(value = "/del")
    R del(
    		@ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "版本Id", required = true) @RequestParam(value = "versionId") String versionId);

    @ApiOperation(value = "审批校验", notes = "发起审批-审批校验")
    @GetMapping(value = "approvedCheck")
    R approvedCheck(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "回款系数版本id", required = true) @RequestParam(name = "versionId") String versionId);

    @ApiOperation(value = "调整板回款系数编辑页面展示", notes = "调整板回款系数编辑页面展示")
    @GetMapping(value = "queryCompileDetail")
    R queryDetail(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "回款系数版本id", required = true) @RequestParam(name = "versionId") String versionId);

    @ApiOperation(value = "回款系数编辑页面保存", notes = "回款系数编辑页面保存")
    @PutMapping(value = "/saveDetail")
    R createSupplyBudgetVersion(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "保存参数", required = true) @RequestBody List<ReturnCoefficientDetail> param);

    @ApiOperation(value = "回款系数审批页面详情展示", notes = "回款系数审批页面详情")
    @GetMapping(value = "/approvalDetail ")
    R getApprovalDetail(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "项目id", required = false) @RequestParam(name = "projectId",required = false) String projectId,
            @ApiParam(value = "审批单id", required = false) @RequestParam(name = "examineId",required = false) String examineId,
            @ApiParam(value = "回款系数版本id", required = false) @RequestParam(name = "versionId",required = false) String versionId);
    
    @ApiOperation(value = "查询回款系数审批预览数据App", notes = "查询回款系数审批预览数据App")
    @GetMapping(value = "approvalPreviewApp")
    R<ReturnPlanApprovalPreviewVo> approvalPreviewApp(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "项目id", required = false) @RequestParam(name = "projectId",required = false) String projectId,
            @ApiParam(value = "审批单id", required = false) @RequestParam(name = "examineId",required = false) String examineId,
            @ApiParam(value = "回款系数版本id", required = false) @RequestParam(name = "versionId",required = false) String versionId);

    @ApiOperation(value = "提交到OA审批", notes = "回款系数审批-提交到OA审批")
    @PostMapping(value = "submitToOA")
    R<String> submitToOA(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "提交审批参数", required = true) @RequestBody ReturnCoefficientContentVo returnCoefficientContentVo);

    @ApiOperation(value = "同步刷新投资正式版回款系数", notes = "同步刷新投资正式版回款系数\n"+
            "不填：全量刷新")
    @PostMapping(value = "getInvest")
    R getInvest(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "项目id", required = false) @RequestParam(name = "projectId", defaultValue = "") String projectId);

    @ApiOperation(value = "修改审批状态仅供（测试使用）", notes = "修改审批状态")
    @PutMapping(value = "/updateState")
    R updateState(
            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
            @ApiParam(value = "版本id", required = true) @RequestParam(name = "versionId") String versionId,
            @ApiParam(value = "审批状态", required = true) @RequestParam(name = "versionState") String versionState);
    
}
